<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var names = ["why", "kobe", "james", "curry"]
    var products = [
      { name: "鼠标", price: 98 },
      { name: "键盘", price: 100 },
      { name: "西瓜", price: 20 },
    ]

    console.log(window.Array)

    var arr1 = new Array()
    var arr2 = new Array("abc", "bbc", "cbc", "nab")
    console.log(arr1, arr2)

    var arr3 = new Array(5)
    console.log(arr3) // [空属性 × 5]

    console.log(names[0])
    console.log(names[names.length - 1])

  </script>
</body>

</html>